import os
import uvicorn
from dotenv import load_dotenv
import multiprocessing

multiprocessing.set_start_method('spawn', force=True)

load_dotenv('.env')

host = os.getenv("HOST", "")
port = int(os.getenv("APP_PORT", ""))
env = os.getenv("ENV", "local")


def main():
    uvicorn.run(
        app="server.server:app",
        host=host,
        port=port,
        reload=True if env == "local" else False,
        workers=1,
    )


if __name__ == "__main__":
    main()
